This section illustrates the simplest of .script files, the most rudimentary form of scripting for MacHTTP.
Here is the classic demonstration program used whenever new programming languages or techniques are demonstrated. This program, "hello-world-01.script" simply returns the text "Hello, World!"
Hello-world-01.script is one line long:
return "Hello, World!"
To create this script:
http://your.domain.edu/hello-world.script
. This is true for all the scripts described here. If you don't open a URL to your scripts through your server (as opposed to using your browser's Open option from the File menu), then the server will not pass the necessary information along to your scripts and/or they will not get executed.The most important thing about this script is not the code itself. Rather, the most important thing is the code was saved as a text file and given a .script extension. Remember your machttp.conf file? With the MacHTTP distribution, the machttp.conf file contained the following MIME type definition:
SCRIPT .SCRIPT TEXT * text/htmlThis definition tells MacHTTP that if a requested file ends in .script, then MacHTTP is suppose to:
Eric last edited this page on September 26, 1995. Please feel free to send comments.